package com.ht.medicaltreatment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.SendProjectConsumableRecord

//收件
class RecipientListAdapter: BaseQuickAdapter<SendProjectConsumableRecord, BaseViewHolder>
    (R.layout.item_send_list_layout) {
    init {
        addChildClickViewIds(R.id.tvS)
    }
    override fun convert(holder: BaseViewHolder, item: SendProjectConsumableRecord) {
        if(holder.adapterPosition == 0){
            holder.setGone(R.id.line,true)
        }else{
            holder.setVisible(R.id.line,true)
        }
        holder.setText(R.id.tvNumber,"快递标识：${item.expressUid}")
        holder.setText(R.id.tvNameJ,item.sender)
        holder.setText(R.id.tvNameS,item.recipientName)
        holder.setText(R.id.tvTimeJ,"寄件时间：${item.createTime}")
        if(item.status == 3 && !item.isSend){
            holder.setVisible(R.id.tvS,true)
        }else{
            holder.setGone(R.id.tvS,true)
        }
        if(item.status == 4){
            holder.setText(R.id.tvTimeS,"签收时间：${item.signingTime}")
            holder.setVisible(R.id.tvTimeS,true)
        }else{
            holder.setGone(R.id.tvTimeS,true)
        }
    }
}
